home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6634 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: hermes.oc.com!usenet
  2. From: Larry Weiss <lfw@oc.com>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Watch out!  C "gotcha!"
  5. Date: Wed, 14 Feb 1996 17:54:23 -0600
  6. Organization: OpenConnect Systems, Dallas, TX, USA
  7. Message-ID: <3122762F.6587@oc.com>
  8. References: <4fthhh$7th@blackice.winternet.com>
  9. NNTP-Posting-Host: ocs2228.oc.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (Win16; I)
  14. CC: lfw@oc.com
  15.  
  16. Michael Schwarz wrote:
  17.  > 
  18.  > Many of you may already know this, but even after ten years of coding
  19.  > in C, this took my by surprise at first.  A co-worker and I were looking
  20.  > at some library C code where I work and we noticed that the "default"
  21.  > clause of one of the switches was misspelled as "defalt."
  22.  > ...
  23.  > The thing that scares me the most about this is that either I've never before
  24.  > made this particular mistake or for the last ten years I've been leaving
  25.  > behind a number of ticking code bombs...
  26.  > 
  27.  > I invite your comments on this (and your knowledge -- I'm a good C programmer
  28.  > but I don't write compilers and I'm not fully conversant with the full
  29.  > ANSI spec on C).  Please feel free to e-mail me.
  30.  > 
  31.  
  32.  
  33. It's a good observation.   I'd suggest a 
  34.  
  35.     grep "t:" *.c | grep -v "default" 
  36.  
  37. or equivalent inspection of any body of C source every once in a while.
  38.